<?php
function smarty_compiler_split($tag_attrs, &$compiler)
{
    $_params = $compiler->_parse_attrs($tag_attrs);

    if (!isset($_params['var'])) {
        $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
        return;
    }

    if (!isset($_params['array'])) {
        $compiler->_syntax_error("assign: missing 'array' parameter", E_USER_WARNING);
        return;
    }

    if (!isset($_params['chunks'])) {
        $compiler->_syntax_error("assign: missing 'chunks' parameter", E_USER_WARNING);
        return;
    }

    return "\$this->assign({$_params['var']}, Misc::array_split({$_params['array']},{$_params['chunks']}));";
}

